package datas
{
	import datas.datasInterior.GuardArmy;
	
	import events.GuardInfoEvent;
	
	import flash.events.Event;

	public class Guard
	{
		//友军的数据信息(全部解析在此处)
		public static var _instance:Guard;
		
		public var blood:uint;
		public var attackMax:uint;
		public var attackMin:uint;
		public var tempo:uint;
		public var scope:uint;
		public var power:uint;
		public var speed:uint;
		public var rebirth:uint;
		public var range:uint;
		public var time:uint;
		public var sky:Boolean;
		public var string:String;
		
		public function Guard(value:SecretKey)
		{
			var guardArmy:GuardArmy = new GuardArmy();
			guardArmy.addEventListener(GuardInfoEvent.GUARD_NEWS,onGuardNews);
		}
		
		protected function onGuardNews(event:Event):void
		{
			var xml:XML = GuardInfoEvent.guardData;
			//trace(xml + "_____________________");
			blood = xml.troops[0].@blood;
			attackMax = xml.troops[0].@attackMax;
			attackMin = xml.troops[0].@attackMin;
			tempo = xml.troops[0].@tempo;
			scope = xml.troops[0].@scope;
			power = xml.troops[0].@power;
			speed = xml.troops[0].@speed;
			rebirth = xml.troops[0].@rebirth;
			range = xml.troops[0].@range;
			time = xml.troops[0].@time;
			sky = xml.troops[0].@sky;
			string = xml.troops[0].@string;
		}
		
		public static function getInstance():Guard{
			if(_instance == null){
				_instance = new Guard(new SecretKey());
			}
			return _instance;
		}
	}
}
class SecretKey{};